This invention relates to the preparation of pharmaceuticals and their intermediates. In particular it relates to an improved process of preparing idelalisib (1). The process runs via acid addition salts of idelalisamine (2). Idelalisamine (2) is a late stage intermediate in the process for preparing idelalisib (1). The acid addition salts of idelalisamine can be purified easily via precipitation/crystallization and provide an easy purification option for a late stage intermediate in the process for preparing idelalisib (1).